package com.west_traveler.find_page_fragment.findpageheaddragment;


import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.squareup.picasso.Picasso;
import com.west_traveler.entity.entity_editor.Imagess;
import com.west_traveler.ximalayafm.R;

/**
 * A simple {@link Fragment} subclass.
 */
public class FindPageHeadPicFragment extends Fragment implements View.OnClickListener {

    private String pic_url;
    private String albumId;
    private String specialId;
    private String trackId;

    public static FindPageHeadPicFragment getInstance(Imagess img) {
        FindPageHeadPicFragment fragment = new FindPageHeadPicFragment();
        Bundle bundle = new Bundle();
        bundle.putString("Pic_URL", img.getPic());
        bundle.putString("AlbumId", img.getAlbumId());
        bundle.putString("SpecialId", img.getSpecialId());
        bundle.putString("TrackId", img.getTrackId());
        fragment.setArguments(bundle);
        return fragment;
    }
    public FindPageHeadPicFragment() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        Bundle bundle = getArguments();
        pic_url = bundle.getString("Pic_URL");
        albumId = bundle.getString("AlbumId");
        specialId = bundle.getString("SpecialId");
        trackId = bundle.getString("TrackId");
        return inflater.inflate(R.layout.fragment_find_page_head_pic, container, false);
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        ImageView imageView = (ImageView) view.findViewById(R.id.iv_find_fource_pic);
        Picasso.with(getActivity()).load(pic_url).into(imageView);
        imageView.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {

    }
}
